const { shell } = require("electron");
const template = [
  {
    label: "文件",
    submenu: [
      {
        label: "新建",
        accelerator: 'CmdorCtrl+N',
        click(menuItem,browserWindow,event) {
          browserWindow.webContents.send('execute-create-file')
        }
      },
      {
        label: "保存",
        accelerator:'CmdorCtrl+s',
        click(menuItem,browserWindow,event) {
          browserWindow.webContents.send('execute-save-file')
        }
      },
      {
        label: "搜索",
        accelerator:'CmdorCtrl+F',
        click(menuItem,browserWindow,event) {
          browserWindow.webContents.send('execute-search-file')
        }
        
      }
    ]
  },
  {
    label: "编辑",
    submenu:[
      {
        label: "撤销",
        accelerator: "CmdOrCtrl + Z",
        role: "undo"
      },
      {
        label: "重做",
        accelerator: "Shift+CmdOrCtrl + z",
        role: "redo"
      },
      {
        label: "剪切",
        accelerator: "CmdorCtrl+x",
        role: "cut"
      },
      {
        label: "复制",
        accelerator: "CmdorCtrl+c",
        role: "copy"
      }
    ]
  }
];
module.exports = template;